function getNotificationIcon(type) {
    switch (type) {
        case 'success':
            return 'bi-check-circle-fill';
        case 'error':
            return 'bi-x-circle-fill';
        case 'warning':
            return 'bi-exclamation-triangle-fill';
        case 'info':
        default:
            return 'bi-info-circle-fill';
    }
}

export function showNotification(message, type = 'info') {
    // 创建通知元素
    const notification = document.createElement('div');
    notification.className = `notification notification-${type}`;
    notification.innerHTML = `
        <div class="notification-content">
            <i class="bi ${getNotificationIcon(type)}"></i>
            <span>${message}</span>
        </div>
        <button class="notification-close">
            <i class="bi bi-x"></i>
        </button>
    `;
    
    // 添加到页面
    document.body.appendChild(notification);
    
    // 添加关闭按钮事件
    notification.querySelector('.notification-close').addEventListener('click', function() {
        notification.remove();
    });
    
    // 自动关闭
    setTimeout(function() {
        notification.classList.add('notification-hide');
        setTimeout(function() {
            notification.remove();
        }, 300);
    }, 3000);
}

export function getProjectOwner() {
    if (window.projectOwner === undefined) {
        window.projectOwner = document.querySelector('.project-path .path').getAttribute('data-project-owner');
    }
    return window.projectOwner;
}

export function getProjectName() {
    if (window.projectName === undefined) {
        window.projectName = document.querySelector('.project-path .path').getAttribute('data-project-name');
    }
    return window.projectName;
}

export function getProjectPath() {
    if (window.projectPath === undefined) {
        const projectOwner = getProjectOwner();
        const projectName = getProjectName();
        window.projectPath = `${projectOwner}/${projectName}`;
    }
    return window.projectPath;
}